package com.jn.news.ui.fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jn.news.R;
import com.jn.news.ui.MedicineSearchActivity;

/**
 * 天行新闻分类页面
 */
public class MedicineSearchFragment extends Fragment {
    public static MedicineSearchFragment newInstance(int position) {
        MedicineSearchFragment fragment = new MedicineSearchFragment();
        Bundle args = new Bundle();
        args.putInt("position", position);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_goods_search, container, false);
        initView(view);
        return view;
    }

    private void initView(View view) {
        view.findViewById(R.id.tv_medicine_search).setOnClickListener(v -> {
            startActivity(new Intent(getActivity(), MedicineSearchActivity.class));
        });
    }
}